/**************************************************
|	File:		CAnimationSystem.h
|	Author:		Jake Elmi
|	Course:		SGP Mari's Flower
|	Purpose:	This class is in charge of loading a
|			    a sprite sheet and rendering it
|				to the screen and updating
**************************************************/

#pragma once
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
using namespace std;

#include <string>
#include <map>
#include <vector>


class CAnimation;
class CAnimTimeStamp;
class CFrames;

class CAnimationSystem
{
	map <string, CAnimation> mAnimation;
	CAnimation* Anim;
	vector <CAnimation*> vAnimation;
	float m_fTimeWaited;
	float m_fSpeed;

public:
	CAnimationSystem(void);
	~CAnimationSystem(void);
	CAnimationSystem(const CAnimationSystem&);
	CAnimationSystem& operator= (const CAnimationSystem&);
	static CAnimationSystem* GetInstance();

	void LoadedAnimation();
	void Render(CAnimTimeStamp *TS, int x, int y, bool bFlipped, float fScale, DWORD dwColor);
	void Update(CAnimTimeStamp *TS, float dt);
	
	vector < CAnimation* > GetListOfAnimations ( void ) { return vAnimation;}
	void SetListOfAnimations( CAnimation* a ) { vAnimation.push_back(a); }

	// Animation XML
	bool LoadAnimation( const char* fileName );
	CFrames*          myFrame;
	CAnimation*       myAnimation;
	CAnimation* pAnimation;

	RECT	GetRect( void )  const { return m_rTemp; }

private:

	RECT	m_rTemp;
};